package com.innovation.chengzhangriji.ui;

import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.view.ViewGroup;
import android.widget.PopupWindow;

import com.innovation.chengzhangriji.R;
import com.innovation.chengzhangriji.ui.BaseActivity;
import com.innovation.chengzhangriji.ui.task.ReadImageSizeTask;
import com.innovation.chengzhangriji.ui.widget.CuteBabyAvatarView;
import com.innovation.chengzhangriji.ui.widget.CuteTextView;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class TestActivity extends BaseActivity {

    PopupWindow popupWindow;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);
//        CuteBabyAvatarView avatarView = (CuteBabyAvatarView) findViewById(R.id.baby_head);
//        CuteBabyAvatarView avatarView2 = (CuteBabyAvatarView) findViewById(R.id.baby_head2);
//        CuteBabyAvatarView avatarView3 = (CuteBabyAvatarView) findViewById(R.id.baby_head3);
//        avatarView.setSex(1);
//        avatarView2.setSex(2);
//        avatarView3.setSex(3);
//        View view = View.inflate(this, R.layout.option_layout_2, null);
//        popupWindow = new PopupWindow(view, ViewGroup.LayoutParams.WRAP_CONTENT,
//                ViewGroup.LayoutParams.WRAP_CONTENT);

//        File file = new File(Environment.getExternalStorageDirectory(), "1.jpg");
//        FileInputStream fileInputStream = null;
//        try {
//            fileInputStream = new FileInputStream(file);
//        } catch (FileNotFoundException e) {
//            e.printStackTrace();
//        }
//        byte[] buffer = new byte[200];
//        try {
//            fileInputStream.read(buffer, 0, 200);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        System.out.println(ReadImageSizeTask.decodeImage(buffer).toString());
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    public void showWindow(View v) {
        popupWindow.showAsDropDown(findViewById(R.id.txt_content));
    }
}
